{% extends 'base_with_top_menu.html' %}

{% block title %}User profile{% endblock %}

{% block header %}User profile - {{first_name}} {{last_name}}{% endblock %}

{% block content %}

    {% if not perms.auth.change_user and not user_id == user.id %}
        <ul class="spaces userProfile">
          <!-- <li><span class="label">Name</span>: {{ first_name }}</li> -->
          <!-- <li><span class="label">Surname</span>: {{ last_name }}</li> -->
          <li><span class="label">E-mail</span>: {{ email|urlize }} {% if display_tips %}<div class="itip">Email link is clickable. Try!</div>{% endif %} </li>
          <li><span class="label">Phones</span>: {% if phones %}
            <ul class="phones">
              {% for p in phones %}
              <li>{{p.type}}:
                {%ifequal p.type "Skype" %}<a class="skype" href="skype:{{p.value}}">{{p.value}}</a>{% else %}{{p.value}}{% endifequal %}
                {%ifequal p.type "Skype" %} {%if display_tips %}<div class="itip">Skype link is clickable. Try!</div>{% endif %}{% endifequal %}
              </li>
              {% endfor %}
            </ul>
            {% else %} None defined {% endif %}
          </li>
          <li><span class="label">Building I work in</span>: {{ building|default_if_none:"Not defined" }}  </li>
          <li><span class="label">Location details</span>: {{ reader.userprofile.location_remarks|default_if_none:"Not defined" }}  </li>
        </ul>
    {% endif %}

    <div class='content_form'> {# Przydala by sie klasa dla tego czegos, jakies menu albo co #}
      <!--
        <b> {% comment %} Przydaloby sie zeby do bylo wieksze, latwiejsze do trafienia i bardziej sie rzucalo w oczy {% endcomment %}
        | <a href='reservations/new/'>Rent something</a>
        | <a href='reservations/'>Reservations</a>
        | <a href='rentals/'>Rentals</a>
        {% if user.id == user_id %}
        | <a href='config/'>Configuration</a>
        {% endif %}
        |
        </b>
      -->

        <div class="inner_menu">
          <ul>
            <li><a href='reservations/new/'>Rent something</a></li>
            <li><a href='reservations/'>Reservations</a> </li>
            <li><a href='rentals/'>Rentals</a></li>
            {% if perms.auth.change_user %}
                {% if not reader.is_active %}
                    <li><a href='{% url activate_user user_id %}'>Activate this user</a></li>
                {% else %}
                    <li><a href='{% url deactivate_user user_id %}'>Deactivate this user</a></li>
                {% endif %}
            {% endif %}
            {% if user.id == user_id %}
                <li><a href='config/'>Configuration</a></li>
            {% endif %}
            {% if user.get_profile.is_librarian %}
            <li><a {%if is_on_leave %}class="turned_on" {%endif%} href="onleave/">On leave</a></li>
            {% endif %}
          </ul>
        </div>
    </div>

    {% block edit_form %}
    {% endblock %}
{% endblock %}
